<%--
 *  File:    DistributortenderBusinessInfo.jsp
 *  @Author: Dcdai
 *  Date:    2011-08-05

 *  Copyright (C) 2000 - 2009 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>
<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.OvalLabel" %>
<%@ page import="com.oval.util.OvalCustomMessage" %>
<%@ page import="com.oval.util.OvalCustomColumn" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  //init param
  //String privilegeCode = "11203";
  String strTableName = "v_tenderproperty";
  String strModuleName = "CRM";
  HashMap userinfo = new HashMap();
  userinfo = (HashMap)session.getAttribute("userinfo");
  Integer neworgid=new Integer(-1);
  if(userinfo.get("orgid")!=null)
  neworgid = (Integer)userinfo.get("orgid");
  String contextPath = request.getContextPath();

%>



<%@ include file="/inc/PageDefault.inc" %>
<%@include file="/inc/Print.inc"%>
<%@ include file="/inc/FrmDefault.inc"%>
<%@ include file="/inc/LocationDefault.inc" %>
<html>
<head>
<title>DistributortenderBusiness</title>
<PageFlow:CheckPageFlow pageName="p_tenderbusiness"/>
	        <%
		        Vector totalsummary = (Vector) pageContext.getAttribute("totalsummary");
		        if (totalsummary == null)
		            totalsummary = new Vector();
		        
		        Vector prods = (Vector) pageContext.getAttribute("prods");
		        if (prods == null)
		        	prods = new Vector();		        
		        
	        %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../../css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="../../js/FuncLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>
<iframe name="reloadHandler" style="display:none" ></iframe>
<%@ include file ="/inc/NewCalendar.inc" %>
<script>


function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(actionsummaryform,actionvalue,orderbyname);
  editform.action = "DistributortenderBusinessInfo.jsp?<%= OvalTools.randomURL() %>&selectopt=all";
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}

function page_add(){
  
   var frm = document.actionsummaryform;
   frm.actionname.value = "add";
   frm.target = "_self";
   isRunning = true;
   frm.submit();
}

function page_delete(){
	
   

	if(nullChecked(document.actionsummaryform.deleteids,"<%=JspHelper.filterNull(totalsummary.size())%>"))
	  {
	    alert("<%= message.getMessageDesc("MUST_SELECT_ONE_RECORD") %>");
	    return;
	  }
	if ( ! confirm("<%= message.getMessageDesc("ARE_YOU_SURE")%>") ) 
	    return;

    
		var frm = document.actionsummaryform;
	    frm.actionname.value = "delete";
		frm.target = "_self";
		isRunning = true;
		frm.submit();


}

function page_return(){
	parent.location.href = "DistributortenderSummary.jsp?<%= OvalTools.randomURL() %>";
}

var popwindow;
function page_selectProvince(noteids)
{
	var id=document.actionsummaryform.distributortenderid.value;
	var noteid=noteids;
  if(popwindow!=null)
    popwindow.close();
  popwindow = window.open('<%=contextPath%>/devlop/distributortender/DistributortenderRegionInfo.jsp?<%= OvalTools.randomURL() %>&languagecode=<%= strLanguageCode %>&countrycode=CN&distributortenderid='+id+'&tenderbusinessid='+noteid,'newwindow', 'height=250, width=600,top=100,left=100,toolbar=n0, menubar=no, scrollbars=no, resizable=no, location=no, status=no');
}

function page_selectCity(noteids)
{
	var id=document.actionsummaryform.distributortenderid.value;
	var noteid=noteids;
  if(popwindow!=null)
    popwindow.close();
  popwindow = window.open('<%=contextPath%>/devlop/distributortender/DistributortenderCityInfo.jsp?<%= OvalTools.randomURL() %>&languagecode=<%= strLanguageCode %>&countrycode=CN&distributortenderid='+id+'&tenderbusinessid='+noteid,'newwindow', 'height=250, width=600,top=100,left=100,toolbar=n0, menubar=no, scrollbars=no, resizable=no, location=no, status=no');
}

function page_selectCounty(noteids)
{
	var id=document.actionsummaryform.distributortenderid.value;
	var noteid=noteids;
  if(popwindow!=null)
    popwindow.close();
  popwindow = window.open('<%=contextPath%>/devlop/distributortender/DistributortenderCountyInfo.jsp?<%= OvalTools.randomURL() %>&languagecode=<%= strLanguageCode %>&countrycode=CN&grade=2&distributortenderid='+id+'&tenderbusinessid='+noteid,'newwindow', 'height=250, width=600,top=100,left=100,toolbar=n0, menubar=no, scrollbars=no, resizable=no, location=no, status=no');
}

</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
 <form name="actionsummaryform" method="post" action="../../Dispatcher">
      <input type="hidden" name="pagename" value="p_tenderbusiness">
      	<input type="hidden" name="actionname">

<table width="100%" cellspacing="0" cellpadding="0" border="0">

  <tr>
    <td>
      <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellpadding="0" width="100%">

        <tr class="deepblue-left">
          <td width="2%"  class="title_center">&nbsp;</td>
          <!-- 
          <td width="40%" class="title_center"><%= label.getLabelName("L_VendorBusinessName")%></td>
           -->
          <td class="title_center" ><%= label.getLabelName("L_OrgCode") %><span class="red">*</span></td>
          <td class="title_center" ><%= label.getLabelName("L_OrgName") %><span class="red">*</span></td>          
          <td width="10%" class="title_center"><%= label.getLabelName("L_Distribution")+ label.getLabelName("L_Province")%></td>
          <td width="10%" class="title_center"><%= label.getLabelName("L_Distribution")+ label.getLabelName("L_City") %></td>
          <td width="10%" class="title_center"><%= label.getLabelName("L_Distribution")+ label.getLabelName("L_YLCounty") %></td>
          <td width="20%" class="title_center"><%= label.getLabelName("L_Distribution")+ label.getLabelName("L_Product") %><span class="red">*</span></td>
        </tr>
        <%int i=0; %>

	        <%
				String distributortenderid = null;
				distributortenderid = (pageContext.getAttribute("distributortenderid")).toString(); 
			%>
            <%

                   boolean bHasChecked = false;
                   String strClassType = new String("");
                   Integer nDefaultId = null;
                   Integer nDisId = null;
                   String strType = "";

             %>

	 <logic:iterate id="actionhash" collection="<%=totalsummary%>" indexId="orderid">
			 <%
				 HashMap tempMap = (HashMap)pageContext.getAttribute("actionhash");
				 String strIsChecked ="";
				  
				  if(i%2 == 1)
			            {
			              strClassType = "td-listrom";
			            }else{
			              strClassType = "none";
			            }
			      if(!bHasChecked)
		            {
		              strIsChecked = "checked";
		              bHasChecked = true; 
		            }   
			      i++;
			 %>
		<tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull(strClassType)%>'" class="<%=JspHelper.filterNull( strClassType )%>">
			 <td>
				<input type="checkbox" name="deleteids" value="<%=JspHelper.filterNull(tempMap.get("tenderbusinessid") )%>" class="checkbox">
			 </td>
			 <!-- 
			 <td><custom:write property="disbusiness" name="actionhash" nbsp="true" /></td>
			  -->
			 <td><custom:write property="orgcode" name="actionhash" nbsp="true" /></td>
			 <td><custom:write property="orgname" name="actionhash" nbsp="true" /></td> 
			 <td class="title_center"><a onclick="page_selectProvince('<custom:write property="tenderbusinessid" name="actionhash" nbsp="true" />');"><custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0"/></a></td>
			 <td class="title_center"><a onclick="page_selectCity('<custom:write property="tenderbusinessid" name="actionhash" nbsp="true" />');"><custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0"/></a></td>
			 <td class="title_center"><a onclick="page_selectCounty('<custom:write property="tenderbusinessid" name="actionhash" nbsp="true" />');"><custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0"/></a></td>
			 <td><custom:write property="prdn" name="actionhash" nbsp="true" /></td>
		</tr>
	 </logic:iterate>
	 <!-- 
	 <tr>
		 <td>&nbsp;</td>
		 <td><custom:textarea property="disbusiness" rows="2" cols="75" name="newhash"/></td>
		 <td class="title_center">
		 	    &nbsp;
		 </td>
		 <td class="title_center">
              	&nbsp;
         </td>
	     <td class="title_center">
	      		&nbsp;
	     </td>
		 <td>
				<custom:select name="newhash" property="prodid" optionsName="prods" optionValueKey="prodid" 
				optionInnerTextKey="prdn" defaultValue="--------------" defaultValueCost="" style="width:80%"/>
		 </td>
	 </tr>
	  -->
			<custom:hidden name="actionhash"  property="distributortenderid" value="<%=distributortenderid%>" />
	          <%@ include file="/inc/SummaryAction.inc" %>

    </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="summary_top" ></td>
        </tr>

        <tr>
          <td class="td_center">
          <!-- 
          <a onclick="page_add();"><custom:button type="1" label="L_Add" imgsrc="new.gif" border="0" style="width:60"/></a>
          <a onclick="page_delete()"><custom:button type="1" label="L_Delete" imgsrc="delete.gif" border="0" style="width:60"/></a>
           -->
		  <a onclick="page_return()"><custom:button type="1" label="L_Back" border="0"  imgsrc="finish.gif" style="width:60" /></a>          
          </td>
        </tr>
      </table>

</table>
 </form>
</body>
</html>